<template>
	<view class="p20">
		<view class="">
			<text class="color-zs">*</text>
			<text>开启接单助手后，根据服务设置中设定好的价格自动匹配订单额度，可直接接单或自主报价。</text>
		</view>
		<view class="mt20 radius20 pl20 pr20 pt24 bg-fff">
			<view class="tit-ac fw-w ml4">订单模式</view>
			<view class="pt32 pb32 flex border-b">
				<view class="flex1">报价模式</view>
				<switch class="scale7" :checked="form.is_offer==1" @change="e=>form.is_offer=e.detail.value*1"
					:color="$zs" />
			</view>
			<view class="pt32 pb32 flex border-b">
				<view class="flex1">一口价订单</view>
				<switch class="scale7" :checked="form.is_fix==1" @change="e=>form.is_fix=e.detail.value*1"
					:color="$zs" />
			</view>
		</view>
		<view class="h120"></view>
		<view class="pf bottom0 left0  w-max flex">
			<view class="p24 flex1">
				<u-button type="warning" ripple @click="submit()">保存设置</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: {
					is_offer: '',
					is_fix: '',
				}
			};
		},
		onLoad(e) {
			for (let key in this.form) {
				this.form[key] = this.$user[key]
			}
		},
		methods: {
			submit() {
				this.$request('/master/my/editInfo', this.form).then(res => {
					this.$msg(res.msg)
					setTimeout(this.$navBack, 1000)
				})
			},
			getList() {
				let params = {
					keyword: this.keyword,
					...this.$params,
				}
				this.$request('/master/task/getTransferMaster', params).then(res => {
					this.list = res.data.data
				})
			},
		}
	}
</script>

<style lang="scss">

</style>
